<!DOCTYPE html>
<html>
<head>
    <title>修复Token并测试</title>
</head>
<body>
    <h1>修复Token并测试Dashboard</h1>
    <p>点击下面的按钮设置token并跳转到dashboard：</p>
    <button onclick="setTokenAndGo()" style="padding: 10px 20px; background: #1890ff; color: white; border: none; border-radius: 4px; cursor: pointer;">设置Token并跳转</button>
    
    <div id="status" style="margin-top: 20px; padding: 10px; background: #f0f0f0; border-radius: 4px;"></div>
    
    <script>
        function setTokenAndGo() {
            const status = document.getElementById('status');
            
            // 设置token
            localStorage.setItem('admin_token', 'test-token-' + Date.now());
            status.innerHTML = '✅ Token已设置: ' + localStorage.getItem('admin_token');
            
            // 等待1秒后跳转
            setTimeout(() => {
                status.innerHTML += '<br/>🔄 正在跳转到dashboard...';
                window.location.href = '/dashboard';
            }, 1000);
        }
        
        // 页面加载时显示当前状态
        window.onload = function() {
            const status = document.getElementById('status');
            const currentToken = localStorage.getItem('admin_token');
            status.innerHTML = '当前Token: ' + (currentToken || '未设置');
        }
    </script>
</body>
</html>